import java.util.*;
/**Re-alocarea unui sir, mai mare...*/
public class Array2 {
	public static void main(String argv[]){
		int nDates = 0;
		final int MAX = 10;
		Calendar dates[] = new Calendar[MAX];
		Calendar c;
		while((c=getDate()) != null){
			if(nDates >= dates.length){
				Calendar tmp[] = new Calendar[dates.length + 10];
				System.arraycopy(dates, 0, tmp, 0, dates.length);
				dates = tmp; //copiaza referintele sirului
			}
			dates[nDates++] = c;
		}
		System.out.println("Marimea sirului: " + dates.length);
	}
	static int n;
	public static Calendar getDate(){
		if (n++ > 21)
			return null;
		return Calendar.getInstance();
	}

}
